//
//  SJClipAreaView.h
//  WSL
//
//  Created by CJ on 2018/3/6.
//  Copyright © 2018年 sanjuetech. All rights reserved.
//

#import <UIKit/UIKit.h>

@class SJClipAreaView;
typedef enum{
    CIRCULARCLIP   = 0,   //圆形裁剪
    SQUARECLIP            //方形裁剪
    
}ClipType;

@protocol ClipAreaViewDelegate <NSObject>

- (void)clipAreaView:(SJClipAreaView *)clipAreaView FinishClipImage:(UIImage *)editImage;

@end


@interface SJClipAreaView : UIView <UIGestureRecognizerDelegate> {
    
    UIImageView *_imageView;
    
    UIView * _overView;
    UIView * _imageViewScale;
    
    CGFloat lastScale;
}

@property (nonatomic, assign) CGFloat scaleRation;//图片缩放的最大倍数
@property (nonatomic, assign) CGFloat radius; //圆形裁剪框的半径

@property (nonatomic, assign) CGFloat clipHeight;
@property (nonatomic, assign) CGFloat clipWidth;

@property (nonatomic, assign) CGRect circularFrame;//裁剪框的frame
@property (nonatomic, assign) CGRect OriginalFrame;
@property (nonatomic, assign) CGRect currentFrame;

@property (nonatomic, assign) ClipType clipType;  //裁剪的形状
@property (nonatomic, weak) id <ClipAreaViewDelegate> delegate;

@property (nonatomic, strong) UIImage *image;


- (UIImage *)getSmallImage;

@end
